<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('待检测列表新增')"/>
</head>
<body>
<form class="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

							<div class="layui-form-item">
			                    <label class="layui-form-label">名义质量</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="nominalMass" autocomplete="off" placeholder="名义质量" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">准确度等级</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="mpe" autocomplete="off" placeholder="准确度等级" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">读数1</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="read1" autocomplete="off" placeholder="读数1" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">读数2</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="read2" autocomplete="off" placeholder="读数2" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">平衡位置</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="eqPosition" autocomplete="off" placeholder="平衡位置" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">分度值</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="division" autocomplete="off" placeholder="分度值" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">相差质量</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="differMass" autocomplete="off" placeholder="相差质量" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">标准砝码约定质量修正值</label>
			                    <div class="layui-input-block">
			                        
			                    	<select name="standardWeightCorrected" th:with="type=${@dict.getType('json')}">
										<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
									</select>
			                    	
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">空气浮力修正</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="airCorrected" autocomplete="off" placeholder="空气浮力修正" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">约定质量修正值</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="massCorrected" autocomplete="off" placeholder="约定质量修正值" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">约定质量允差</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="massTolerance" autocomplete="off" placeholder="约定质量允差" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">磁化率读数</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="magneticReads" autocomplete="off" placeholder="磁化率读数" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">磁化率允差</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="magneticTolerance" autocomplete="off" placeholder="磁化率允差" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">极化强度读数</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="polarizationReads" autocomplete="off" placeholder="极化强度读数" class="layui-input">
			                    </div>
			                </div>
		

							<div class="layui-form-item">
			                    <label class="layui-form-label">极化强度允差</label>
			                    <div class="layui-input-block">
			                        <input type="text" name="polarizationTolerance" autocomplete="off" placeholder="极化强度允差" class="layui-input">
			                    </div>
			                </div>
		

            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="scaletab-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<script>
    layui.use(['form','laydate','jquery'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        let MODULE_PATH = rootPath+"/ScaletabController";


        //保存
        form.on('submit(scaletab-save)', function (data) {
        	let loader = layer.load();
            $.ajax({
                url: MODULE_PATH+'/add',
                data: data.field,
                dataType: 'json',
                contentType: 'application/x-www-form-urlencoded',
                type: 'post',
                success: function (result) {
                    if (result.code==200) {
                        layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("scaletab-table");
                            layer.close(loader);
                        });
                    } else {
                        layer.msg(result.msg, {icon: 2, time: 1000});
                        layer.close(loader);
                    }
                }
            })
            return false;
        });
    })
</script>
</body>
</html>